# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gptfdisk
pkgver=1.0.5
pkgrel=0
pkgdesc="Text-mode partitioning tool that works on Globally Unique Identifier (GUID) Partition Table (GPT) disks"
arch="all"
url="https://www.rodsbooks.com/gdisk"
options="!check"  # No test suite.
license="GPL-2.0-or-later"
makedepends="ncurses-dev e2fsprogs-dev popt-dev linux-headers"
subpackages="$pkgname-doc sgdisk"
source="https://downloads.sourceforge.net/project/gptfdisk/gptfdisk/$pkgver/gptfdisk-$pkgver.tar.gz
	fix-wrong-include.patch
	"

build() {
	make CXX="${CXX:-g++}" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
}

package() {
	mkdir -p "$pkgdir"/usr/bin "$pkgdir"/usr/share/man/man8
	local i; for i in gdisk cgdisk sgdisk fixparts; do
		install $i "$pkgdir"/usr/bin/
		install $i.8 "$pkgdir"/usr/share/man/man8/
	done
}

sgdisk() {
	pkgdesc="Command-line GUID partition table (GPT) manipulator"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/sgdisk "$subpkgdir"/usr/bin/
}

sha512sums="3d3a59e3488dd3d6bda5d103b9ad8b7936752210346b9787ddc936681498fba90577b6ae950c471d09a01bf6405fce32038ff1777c52db0b21e5277737fe3703  gptfdisk-1.0.5.tar.gz
7bb67d132e53cd66a4ae954b4a78f6841c3cdb60bee7cbbecbe1667b95292513fc1561261861607d79164e592faf2045ae51b08ff74ebb5097ad760280307995  fix-wrong-include.patch"
